package cn.com.wdjedu.androidapp.wjeduandroid.ui.videoshow.fragment;

import android.view.View;
import android.widget.AdapterView;
import android.widget.BaseAdapter;

import java.util.ArrayList;
import java.util.List;

import cn.com.wdjedu.androidapp.wjeduandroid.R;
import cn.com.wdjedu.androidapp.wjeduandroid.mvp.main.MainPresenter;
import cn.com.wdjedu.androidapp.wjeduandroid.ui.baseui.ListViewFragment;
import cn.com.wdjedu.androidapp.wjeduandroid.ui.videoshow.adpter.CommentFragmentAdapter;
import cn.com.wdjedu.androidapp.wjeduandroid.ui.videoshow.bean.CommentBean;

/**
 * 评论页面
 */
public class CommentFragment extends ListViewFragment<CommentBean,MainPresenter> {


    @Override
    public List<CommentBean> getList() {
        List<CommentBean> lists=new ArrayList<>();
        CommentBean commentBean;

        for (int i=0;i<8;i++){
            commentBean=new CommentBean();
            commentBean.setUserName("小哲Sunflower"+i);
            commentBean.setLikes(2+i);
            commentBean.setTime("1小时前");
            commentBean.setComment("作为一个初学者，这个教程非常好，也很适合在上班的时候学习，也很容易理解");

            lists.add(commentBean);
        }

//        chaterBean.setList(l);
//        lists.add(chaterBean);
        return lists;
    }

    @Override
    protected BaseAdapter buildListAdapter() {
        lists=new ArrayList<>();
        lists=getList();
       // listAdapter=new ChapterFragmentAdapter(getActivity(), R.layout.item_viewshow_chapter,lists);
        listAdapter = new CommentFragmentAdapter(getActivity(),R.layout.item_viewshow_comment,lists);
        getListView().setAdapter(listAdapter);
        return listAdapter;
    }

    @Override
    protected void listViewItemClick(AdapterView parent, View view, int position, long id) {

    }

    @Override
    protected MainPresenter createPresenter() {
        return null;
    }
}
